<?php

namespace app\admin\system\logic;

use app\common\logic\BaseLogic;
use app\model\SysAdmin;
use support\constants\CacheKey;
use support\utils\CacheUtil;

class AdminLogic extends BaseLogic
{
    public function __construct()
    {
        $this->model = new SysAdmin();
    }

    /**
     * 获取当前登录人信息
     * @param $uid
     * @return mixed
     */
    static function getCurrentLogicAdmin($uid)
    {
        return CacheUtil::remember(CacheKey::LOGIN_KEY . $uid, function () use ($uid) {
            return (new SysAdmin)->getUserById($uid)->toArray();
        }, 24 * 60 * 60);
    }


}